package cn.passlink.www.Utils;
import lombok.extern.slf4j.Slf4j;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Slf4j
public class JsonUtils {
//    返回列表数据
    public static  Map<String, Object> dataListJson(Integer code, List<?> dataList, String msg,Integer page_all_num) {
        Map<String, Object> result = new HashMap<>();
        Map<String, Object> data = new HashMap<>();
        data.put("list", dataList);
        data.put("page_all_num", page_all_num);
        result.put("code", code);
        result.put("data", data);
        result.put("msg", msg);
        return result;
    }
//返回对象数据
    public static Map<String, Object> dataJson(Integer code, Object datas, String msg) {
        Map<String, Object> result = new HashMap<>();
        result.put("code", code);
        result.put("data", datas);
        result.put("msg", msg);
        return result;
    }
    public static Map<String, Object> resultJson(Integer code, String msg) {
        Map<String, Object> result = new HashMap<>();
        result.put("code", code);
        result.put("msg", msg);

        return result;
    }


}
